package com.example.demo.proxy3;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AopTest {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        ChildService childService = context.getBean(ChildService.class);

        childService.childMethod(); // 触发 AOP
        childService.parentMethod(); // 不会触发 AOP
    }
}
